package com.tico.editor.editors.task;

import com.tico.editor.editors.domain.HttpEditor;
import com.tico.editor.editors.domain.TaskScheduled;
import com.tico.editor.editors.service.HttpEditorService;

import java.util.Date;

public class MyTask extends ScheduleTask {
    private String id;
    private TaskScheduled taskScheduled;
    private HttpEditorService httpEditorService;

    public MyTask(String id, String id1, TaskScheduled taskScheduled, HttpEditorService httpEditorService) {
        super(id);
        this.id = id1;
        this.taskScheduled = taskScheduled;
        this.httpEditorService = httpEditorService;
    }

    @Override
    public void run() {
        //todo Your operation
        System.out.println(new Date() + "任务" + this.getId() + "--------"+taskScheduled.getTaskName()+"开始执行...hello world!");
        HttpEditor byId = httpEditorService.findById(taskScheduled.getTaskId());
        httpEditorService.postmanReal(byId);
    }
}

